using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeWeb;
using System.Transactions;
using GC2.Entities.Logistica;
using GC2.ExceptionHandler.Services;
using GC2.DataAccess.DALogistica;

namespace GC2.Bussines.BMLogistica
{
    public class BMHRutaDet
    {
        public BMHRutaDet(string coneccion)
        {
            this.Connection = coneccion;
        }

        private string connection = "";
        public string Connection
        {
            get { return connection; }
            set { connection = value; }
        }

        DAHRutaDet daHRutaDet = new DAHRutaDet();

        #region BMHRutaDetInsert
        public void BMHRutaDetInsert(HRutaDet hrutaDet)
        {
            try
            {
                daHRutaDet.DAHRutaDetInsert(Connection, hrutaDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMHRutaDetUpdateEntregar
        public void BMHRutaDetUpdateEntregar(HRutaDet hrutaDet)
        {
            try
            {
                daHRutaDet.DAHRutaDetUpdateEntregar(Connection, hrutaDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMHRutaDetUpdateImputar
        public void BMHRutaDetUpdateImputar(HRutaDet hrutaDet)
        {
            try
            {
                daHRutaDet.DAHRutaDetUpdateImputar(Connection, hrutaDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMHRutaDetGetAll
        public List<HRutaDet> BMHRutaDetGetAll(HRutaDet hrutaDet)
        {
            List<HRutaDet> listaHRutaDet = new List<HRutaDet>();
            try
            {
                listaHRutaDet = daHRutaDet.DAHRutaDetGetAll(Connection, hrutaDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
            return listaHRutaDet;
        }
        #endregion

        #region BMHRutaDetGetAllByPagina
        public List<HRutaDet> BMHRutaDetGetAllByPagina(HRutaDet hrutaDet)
        {
            List<HRutaDet> listaHRutaDet = new List<HRutaDet>();
            try
            {
                listaHRutaDet = daHRutaDet.DAHRutaDetGetAllByPagina(Connection, hrutaDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
            return listaHRutaDet;
        }
         #endregion

        #region BMHRutaDetGetAllByCliente
        public List<HRutaDet> BMHRutaDetGetAllByCliente(HRutaDet hrutaDet)
        {
            List<HRutaDet> listaHRutaDet = new List<HRutaDet>();
            try
            {
                listaHRutaDet = daHRutaDet.DAHRutaDetGetAllByCliente(Connection, hrutaDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
            return listaHRutaDet;
        }
        #endregion

        #region BMHRutaDetDelete
        public void BMHRutaDetDelete(HRutaDet hrutaDet)
        {
            try
            {
                daHRutaDet.DAHRutaDetDelete(Connection, hrutaDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMHRutaDetGetOneByRemito
        public HRutaDet BMHRutaDetGetOneByRemito(HRutaDet hrutaDet)
        {
            HRutaDet oHRutaDet = new HRutaDet();
            try
            {
                oHRutaDet = daHRutaDet.DAHRutaDetGetOneByRemito(Connection, hrutaDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
            return oHRutaDet;
        }
        #endregion
    }
}



